home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / asmsrc / resetled.lha / RESET_LED.s
Encoding:
Text File  |  1989-03-06  |  1.4 KB  |  70 lines

  1. Routine provided by STARR/Cyrus Corp - UK.
  2. ------------------------------------------
  3.  
  4. ** This routine switches off the POWER LED during
  5. ** the reset routine.
  6. ** This enables you to run utilities/games that
  7. ** load off BootBlocks with the filter off
  8. ** (A500 and some A1000).
  9.  
  10. Execbase=4
  11. CoolCapture=46
  12.  
  13. ** Wait for the drive light to go out
  14.  
  15.         move.l #$fffff,d0
  16. Wait:        subq.l #1,d0
  17.         bne Wait
  18.  
  19. ** Get new reset address, move old address into
  20. ** a store and calculate Checksum.
  21.  
  22.         lea reset,a0
  23.         move.l Execbase,a6
  24.         move.l CoolCapture(a6),Normal
  25.         bsr Set_Reset
  26.  
  27. ** Do the nice colours bit
  28.  
  29.         move.w #$7fff,d0
  30.         move.w d0,$dff096
  31.         move.w d0,$dff09a
  32. l:        move.w d0,$dff180
  33.         subq.l #1,d0
  34.         jmp l
  35.  
  36. ** This routine writes the reset address
  37. ** and Calculates the checksum of Exec.
  38. ** This is done to allow the reset
  39. ** Routine to be run. If the checksum is
  40. ** not calculated the Reset routine will
  41. ** NOT WORK!
  42.  
  43. Set_Reset:    move.l a0,CoolCapture(a6)
  44.         clr.l d0
  45.         move.l d0,d1
  46.         lea 34(a6),a0
  47.         move.b #$16,d0
  48. Checksum:    add.w (a0)+,d1
  49.         dbf d0,Checksum
  50.         not.w d1
  51.         move.w d1,82(a6)
  52.         rts
  53.  
  54. ** This is the reset routine!
  55. ** It sets the reset vectors back to what they
  56. ** were prior to running this program and 
  57. ** calculates the checksum for Exec. Finally,
  58. ** it turns the power light off and passes
  59. ** control back to the Initialization routine.
  60.  
  61. Reset:        move.l Normal,a0
  62.         move.l Execbase,a6
  63.         bsr Set_Reset
  64.         bset #1,$bfe001
  65.         rts
  66.  
  67. ** Store for old reset vector
  68.  
  69. Normal:        dc.l 0
  70.